<%= javascript_include_tag "mytable.js" %>
<%= stylesheet_link_tag 'mytable'%>
<h1>选择导师</h1>
<table class="mytable">
  <thead>
    <th>姓名</th>
    <th>类型</th>
    <th>名额</th>
    <th>被邀请</th>
    <th>已完成</th>
    <th>双选详细</th>
    <th>点击邀请</th>
  </thead>
  <tbody>
    <%
    for quantity in @quantities
      tea_id = quantity.tea_id
      invited = Choice.invited_count(tea_id)
      finished = Choice.finished_count(tea_id)
      -%>
      <tr>
        <td><%=h quantity.tname %></td>
        <td><%=h quantity.stu_type %></td>
        <td><strong><%=h quantity.numbers %></strong></td>
        <td><strong><%=h invited %></strong></td>
        <td><strong><%=h finished %></strong></td>
        <td>
          <%= link_to '详细',
            :action => 'choice_details', :id => quantity.tea_id %>
        </td>
        <td><%= link_to '邀请',
          :action => 'stu_invite_tea', :id => quantity.tea_id %></td>
      </tr>
    <% end %>
  </tbody>
</table>

